home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 25 / Cream of the Crop 25.iso / utility / ffe101.zip / GRAPH.SWG / 0014_PCX.pas < prev    next >
Pascal/Delphi Source File  |  1996-09-04  |  3KB  |  63 lines

  1. --------I-PCX-------------------------------
  2.  
  3. The PCX files are created by the programs of the ZSoft Paintbrush family
  4. and  the  FRIEZE package by the  same  manufacturer. A PCX file contains
  5. only one image, the data for this image and possibly palette information
  6. for  this  image. The encoding scheme used  for PCX encoding is a simple
  7. RLE  mechanism, see ALGRTHMS.txt for further information. A PCX image is
  8. stored from the upper scan line to the lower scan line.
  9.  
  10. The  size  of  a decoded scan line  is  always  an even number, thus one
  11. additional byte should always be allocated for the decoding buffer.
  12.  
  13. The header has a fixed size of 128 bytes and looks like this :
  14. OFFSET              Count TYPE   Description
  15. 0000h                   1 byte   Manufacturer.
  16.                                  10=ZSoft
  17. 0001h                   1 byte   Version information
  18.                                   0=PC Paintbrush v2.5
  19.                                   2=PC Paintbrush v2.8 w palette information
  20.                                   3=PC Paintbrush v2.8 w/o palette information
  21.                                   4=PC Paintbrush/Windows
  22.                                   5=PC Paintbrush v3.0+
  23. 0002h                   1 byte   Encoding scheme, 1 = RLE, none other known
  24. 0003h                   1 byte   Bits per pixel
  25. 0004h                   1 word   left margin of image
  26. 0006h                   1 word   upper margin of image
  27. 0008h                   1 word   right margin of image
  28. 000Ah                   1 word   lower margin of image
  29. 000Ch                   1 word   Horizontal DPI resolution
  30. 000Eh                   1 word   Vertical DPI resolution
  31. 0010h                  48 byte   Color palette setting for 16-color images
  32.                                  16 RGB triplets
  33. 0040h                   1 byte   reserved
  34. 0041h                   1 byte   Number of color planes
  35.                                  ="NCP"
  36. 0042h                   1 word   Number of bytes per scanline (always even,
  37.                                  use instead of right margin-left margin).
  38.                                  ="NBS"
  39. 0044h                   1 word   Palette information
  40.                                   1=color/bw palette
  41.                                   2=grayscale image
  42. 0046h                   1 word   Horizontal screen size
  43. 0048h                   1 word   Vertical screen size
  44. 004Ah                  54 byte   reserved, set to 0
  45.  
  46. The  space needed to decode a single scan line is "NCP"*"NBS" bytes, the
  47. last byte may be a junk byte which is not displayed.
  48.  
  49. After  the  image data, if the version  number  is 5 (or greater?) there
  50. possibly  is  a VGA color palette. The color  ranges from 0 to 255, 0 is
  51. zero  intensity,  255 is full intensity.  The  palette has the following
  52. format :
  53.  
  54. OFFSET              Count TYPE   Description
  55. 0000h                   1 byte   VGA palette ID (=0Ch)
  56. 0001h                 768 byte   RGB triplets with palette information
  57.  
  58. EXTENSION:PCX
  59. OCCURENCES:PC
  60. PROGRAMS:PC Paintbrush
  61. SEE ALSO:
  62.  
  63.